from apps.common.base.views import *
from apps.common.third.createCode import createCode

class ThirdViewSet(BaseViewSet):

    '''生成二维码'''
    @action(methods=['post'], detail=False, authentication_classes=[],permission_classes=[])
    def createCode(self, request):
        params = getRequestParams(request)
        if isEmptyStr(params.get('content')):
            return Response(response_message('content字段必填'))
        return Response(response_success(createCode(params)))
